//
// Created by Jisam on 2024/7/25 22:12.
// solve P1433 吃奶酪 状压DP2
#include <iostream>
#include <cmath>
#include <vector>
#include <limits>
#include <bit>
using  namespace std;
using db = double;

db dis(int a, int b, const vector<db>& x, const vector<db>& y) {
    return sqrt((x[a] - x[b]) * (x[a] - x[b]) + (y[a] - y[b]) * (y[a] - y[b]));
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<db> x(n + 1), y(n + 1);
    for (int i = 1; i <= n; ++i) {
        cin >> x[i] >> y[i];
    }

    vector<vector<db>> f(n + 1, vector<db>(1 << (n + 1), numeric_limits<db>::max()));
    for (int s = 1; s < (1 << n); ++s) {
        for (int i = 1; i <= n; ++i) {
            if ((s & (1 << (i - 1))) == 0) continue;
            if (s == (1 << (i - 1))) {
                f[i][s] = 0;
                continue;
            }
            for (int j = 1; j <= n; ++j) {
                if ((s & (1 << (j - 1))) == 0 || i == j) continue;
                f[i][s] = min(f[i][s], f[j][s ^ (1 << (i - 1))] + dis(i, j, x, y));
            }
        }
    }

    db ans = -1;
    for (int i = 1; i <= n; ++i) {
        db s = f[i][(1 << n) - 1] + dis(i, 0, x, y);
        if (ans == -1 || ans > s) ans = s;
    }

    cout.precision(2);
    cout << fixed << ans << endl;
    return 0;
}
